package com.spi.soconversion.base.definition;

import java.math.BigDecimal;

import com.spi.soconversion.util.SOCConstants;
import com.spi.soconversion.util.SOCUtility;
import com.spi.soconversion.util.XMLAttributeConstants;
import com.spi.soconversion.util.XMLTagConstants;

public class SOCOrderLineTax {
	
	private BigDecimal taxAmount;
	private String taxName;
	private String chargeCategory;
	private String chargeName;
	private String taxPercentage;
	private String taxableFlag =SOCConstants.FLAG_Y;

	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer();

		sb.append(XMLTagConstants.START_TAG_LINE_TAX);
		sb.append(SOCConstants.BLANK_STRING);
		
		sb.append(SOCUtility.getAttribute(XMLAttributeConstants.CHARGE_CATEGORY, getChargeCategory()));
		sb.append(SOCConstants.BLANK_STRING);
		
		sb.append(SOCUtility.getAttribute(XMLAttributeConstants.CHARGE_NAME,	getChargeName()));
		sb.append(SOCConstants.BLANK_STRING);
		
		sb.append(SOCUtility.getAttribute(XMLAttributeConstants.TAX_NAME,getTaxName()));
		sb.append(SOCConstants.BLANK_STRING);
		
		sb.append(SOCUtility.getAttribute(XMLAttributeConstants.TAX_PERCENTAGE, getTaxPercentage()));
		sb.append(SOCConstants.BLANK_STRING);
		
		sb.append(SOCUtility.getAttribute(XMLAttributeConstants.TAX,getTaxAmount().toString()));
		sb.append(SOCConstants.BLANK_STRING);
		
		sb.append(SOCUtility.getAttribute(XMLAttributeConstants.TAX_FLAG,getTaxableFlag()));

		sb.append(SOCConstants.CLOSING_XML_TAG);
		sb.append(SOCConstants.NEW_LINE);

		sb.append(XMLTagConstants.END_TAG_LINE_TAX);

		return sb.toString();
	}

	public String getChargeName() {
		return chargeName;
	}

	public void setChargeName(String chargeName) {
		this.chargeName = chargeName;
	}

	public String getChargeCategory() {
		return chargeCategory;
	}

	public void setChargeCategory(String chargeCategory) {
		this.chargeCategory = chargeCategory;
	}

	public void setTaxAmount(BigDecimal taxAmount) {
		this.taxAmount = taxAmount;
	}

	public BigDecimal getTaxAmount() {
		return taxAmount;
	}

	public String getTaxName() {
		return taxName;
	}

	public void setTaxName(String taxName) {
		this.taxName = taxName;
	}

	public String getTaxPercentage() {
		return taxPercentage;
	}

	public void setTaxPercentage(String taxPercentage) {
		this.taxPercentage = taxPercentage;
	}

	public String getTaxableFlag() {
		return taxableFlag;
	}
}
